<?php
// para colocar slide de noticias em destaque
	require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/controle/NoticiasController.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/Prototipo/controle/ImagemController.php');
	
	$ctrlNoticia = new NoticiasController();
	$ctrlImagem = new ImagemController();
	
	$recebe = $ctrlNoticia->loadSlider();
	
	
?>

<h2><img src="img/layout/index/Tipografia_NoticiaEmDestaque.png"></h2>
<div id="myCarousel" class="carousel slide">
  <!-- <ol class="carousel-indicators">
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    <li data-target="#myCarousel" data-slide-to="1"></li>
    <li data-target="#myCarousel" data-slide-to="2"></li>
  </ol>-->
  <!-- Carousel items -->
  <div class="carousel-inner">
    <div class="active item">
    	<?php 
    		$img = $ctrlImagem->loadImagem($recebe[0]->getIdNoticia());
    		$i = explode('../', $img->getDiretorio());
    		echo '<img src="'.$i[1].$img->getNome().'" height="160" >';
    	?>
    	<div class="carousel-caption">
    		<h4><a href="?pg=noticia&id=<?php echo $recebe[0]->getIdNoticia();?>" class="semlink"><?php echo $recebe[0]->getTitulo();?></a></h4>
    	</div>
    </div>
    <div class="item">
    	<?php 
    		$img = $ctrlImagem->loadImagem($recebe[1]->getIdNoticia());
    		$i = explode('../', $img->getDiretorio());
    		echo '<img src="'.$i[1].$img->getNome().'" width="570" height="260">';
    	?>
    	<div class="carousel-caption">
    		<h4><a href="?pg=noticia&id=<?php echo $recebe[1]->getIdNoticia();?>" class="semlink"> <?php echo $recebe[1]->getTitulo();?></a></h4>
    	</div>
    </div>
    <div class="item">
    	<?php 
    		$img = $ctrlImagem->loadImagem($recebe[2]->getIdNoticia());
    		$i = explode('../', $img->getDiretorio());
    		echo '<img src="'.$i[1].$img->getNome().'" width="570" height="260">';
    	?>
    	<div class="carousel-caption">
    		<h4><a href="?pg=noticia&id=<?php echo $recebe[2]->getIdNoticia();?>" class="semlink"> <?php echo $recebe[2]->getTitulo();?></a></h4>
    	</div>
    </div>
  </div>
  <!-- Carousel nav -->
  <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
  <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div>

<?php 
	//$img = $ctrlImagem->loadImagem($recebe[0]->getIdNoticia());
	//$i = explode('../', $img->getDiretorio());
    //echo '<img src="'.$i[1].$img->getNome().'" alt>';
?>